Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(perf): try using vec-collections's VecSet in AliasSet #7058

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

asterite
Copy link
Collaborator

@asterite asterite commented Jan 14, 2025

Description

Problem

Related to #7001

Summary

Alternative to #7057

Additional Context

Documentation

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

github-actions bot commented Jan 14, 2025

Execution Memory Report

Program Peak Memory
keccak256 74.67M
workspace 123.72M
regression_4709 316.00M
ram_blowup_regression 512.61M
rollup-base-public 478.87M
rollup-base-private 325.48M
private-kernel-tail 180.47M
private-kernel-reset 245.16M
private-kernel-inner 208.55M

Copy link
Contributor

github-actions bot commented Jan 14, 2025

Compilation Memory Report

Program Peak Memory %
keccak256 77.91M -2%
workspace 123.59M 0%
regression_4709 424.09M 0%
ram_blowup_regression 1.58G 0%
rollup-base-public 3.50G -25%
rollup-base-private 989.55M 100%
private-kernel-tail 207.18M 0%
private-kernel-reset 669.26M 0%
private-kernel-inner 294.40M 0%

Copy link
Contributor

github-actions bot commented Jan 14, 2025

Execution Report

Program Execution Time %
sha256_regression 0.052s -2%
regression_4709 0.001s 0%
ram_blowup_regression 0.606s 0%
rollup-root 0.105s 0%
rollup-merge 0.006s 0%
rollup-block-merge 0.105s -1%
rollup-base-public 1.232s 0%
rollup-base-private 0.461s 1%
private-kernel-tail 0.019s 0%
private-kernel-reset 0.313s 0%
private-kernel-inner 0.068s 0%

Copy link
Contributor

github-actions bot commented Jan 14, 2025

Compilation Report

Program Compilation Time %
sha256_regression 1.360s 10%
regression_4709 0.788s 0%
ram_blowup_regression 16.600s -1%
rollup-root 3.430s -2%
rollup-merge 1.980s 9%
rollup-block-merge 3.524s 2%
rollup-base-public 38.680s -4%
rollup-base-private 14.540s 17%
private-kernel-tail 0.922s -10%
private-kernel-reset 6.294s -9%
private-kernel-inner 2.124s 4%

@TomAFrench
Copy link
Member

Looks very similar in performance, up to you about which solution you prefer.

@asterite
Copy link
Collaborator Author

Yup, it seems it's exactly the same regarding memory :-)

Compilation times are different (on the left is the other PR):

image

But I guess those numbers vary more so we can't conclude one is better than the other.

I think I prefer this PR because there are less cases to handle. You?

@asterite asterite changed the title chore: try using vec-collections's VecSet in AliasSet chore(perf): try using vec-collections's VecSet in AliasSet Jan 14, 2025
@asterite
Copy link
Collaborator Author

Actually, I'll first ask Akosh to profile it locally to see if we get the same results as #7057 (comment)

@TomAFrench
Copy link
Member

Those seem to all be within margin of error.

I think I prefer this PR because there are less cases to handle. You?

Yeah, I think as long as we're not feeling limited by this library then we can just stick with it. We know that we can easily chuck it if necessary.

@aakoshh
Copy link
Contributor

aakoshh commented Jan 14, 2025

This has virtually the same profile:

Screenshot 2025-01-14 at 15 19 33

Copy link
Contributor

@aakoshh aakoshh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go with this one because d376513 had to repeat the entire match and I already used e.g. !self.is_unknown() instead of true for example. The earlier version with the 2 cases to consider for should_unify were easier to grok.

@TomAFrench TomAFrench marked this pull request as ready for review January 14, 2025 15:51
@TomAFrench
Copy link
Member

@asterite Do you want to merge this as is or are there changes you want to make?

@asterite
Copy link
Collaborator Author

Yes, soon. Akosh asked me a few minutes to try to profile this together with his other PR.

@TomAFrench
Copy link
Member

Will let you hit the merge button.

@aakoshh
Copy link
Contributor

aakoshh commented Jan 14, 2025

This is what it looks like with this merged into #7053

There is a strange plateuing of the memory, instead of the pronounced peak with the other variant.

Screenshot 2025-01-14 at 16 04 06

But overall it looks similar:
Screenshot 2025-01-14 at 16 07 59

@asterite asterite added this pull request to the merge queue Jan 14, 2025
@aakoshh aakoshh mentioned this pull request Jan 14, 2025
5 tasks
Merged via the queue into master with commit b6097a0 Jan 14, 2025
92 checks passed
@asterite asterite deleted the ab/mem2reg-alias-set-small-set branch January 14, 2025 16:27
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 14, 2025
…oir-lang/noir#7066)

feat!: Handle generic fields in `StructDefinition::fields` and move old functionality to `StructDefinition::fields_as_written` (noir-lang/noir#7067)
chore(ci): Check various inliner aggressiveness setttings in Brillig reports (noir-lang/noir#7049)
chore: reenable reports on rollup root circuits (noir-lang/noir#7061)
fix: don't always select trait impl when verifying trait constraints (noir-lang/noir#7041)
chore: mark some critical libraries as good again (noir-lang/noir#7065)
fix: Reduce memory usage in mem2reg (noir-lang/noir#7053)
feat: Allow associated types to be ellided from trait constraints (noir-lang/noir#7026)
chore(perf): try using vec-collections's VecSet in AliasSet (noir-lang/noir#7058)
chore: reduce number of iterations of `acvm::compiler::compile` (noir-lang/noir#7050)
chore: add `noir_check_shuffle` as a critical library (noir-lang/noir#7056)
chore: clippy warning fix (noir-lang/noir#7051)
chore(ci): Unify compilation/execution report jobs that take averages with single runs  (noir-lang/noir#7048)
fix(nargo_fmt): let doc comment could come after regular comment (noir-lang/noir#7046)
fix(nargo_fmt): don't consider identifiers the same if they are equal… (noir-lang/noir#7043)
feat: auto-import traits when suggesting trait methods (noir-lang/noir#7037)
feat: avoid inserting `inc_rc` instructions into ACIR (noir-lang/noir#7036)
fix(lsp): suggest all possible trait methods, but only visible ones (noir-lang/noir#7027)
chore: add more protocol circuits to reports (noir-lang/noir#6977)
feat: avoid generating a new witness when checking if linear expression is zero (noir-lang/noir#7031)
feat: skip codegen of zero iteration loops (noir-lang/noir#7030)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 14, 2025
…ir#7066)

feat!: Handle generic fields in `StructDefinition::fields` and move old functionality to `StructDefinition::fields_as_written` (noir-lang/noir#7067)
chore(ci): Check various inliner aggressiveness setttings in Brillig reports (noir-lang/noir#7049)
chore: reenable reports on rollup root circuits (noir-lang/noir#7061)
fix: don't always select trait impl when verifying trait constraints (noir-lang/noir#7041)
chore: mark some critical libraries as good again (noir-lang/noir#7065)
fix: Reduce memory usage in mem2reg (noir-lang/noir#7053)
feat: Allow associated types to be ellided from trait constraints (noir-lang/noir#7026)
chore(perf): try using vec-collections's VecSet in AliasSet (noir-lang/noir#7058)
chore: reduce number of iterations of `acvm::compiler::compile` (noir-lang/noir#7050)
chore: add `noir_check_shuffle` as a critical library (noir-lang/noir#7056)
chore: clippy warning fix (noir-lang/noir#7051)
chore(ci): Unify compilation/execution report jobs that take averages with single runs  (noir-lang/noir#7048)
fix(nargo_fmt): let doc comment could come after regular comment (noir-lang/noir#7046)
fix(nargo_fmt): don't consider identifiers the same if they are equal… (noir-lang/noir#7043)
feat: auto-import traits when suggesting trait methods (noir-lang/noir#7037)
feat: avoid inserting `inc_rc` instructions into ACIR (noir-lang/noir#7036)
fix(lsp): suggest all possible trait methods, but only visible ones (noir-lang/noir#7027)
chore: add more protocol circuits to reports (noir-lang/noir#6977)
feat: avoid generating a new witness when checking if linear expression is zero (noir-lang/noir#7031)
feat: skip codegen of zero iteration loops (noir-lang/noir#7030)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 15, 2025
…ir#7070)

feat(LSP): code action to import trait in a method call (noir-lang/noir#7066)
feat!: Handle generic fields in `StructDefinition::fields` and move old functionality to `StructDefinition::fields_as_written` (noir-lang/noir#7067)
chore(ci): Check various inliner aggressiveness setttings in Brillig reports (noir-lang/noir#7049)
chore: reenable reports on rollup root circuits (noir-lang/noir#7061)
fix: don't always select trait impl when verifying trait constraints (noir-lang/noir#7041)
chore: mark some critical libraries as good again (noir-lang/noir#7065)
fix: Reduce memory usage in mem2reg (noir-lang/noir#7053)
feat: Allow associated types to be ellided from trait constraints (noir-lang/noir#7026)
chore(perf): try using vec-collections's VecSet in AliasSet (noir-lang/noir#7058)
chore: reduce number of iterations of `acvm::compiler::compile` (noir-lang/noir#7050)
chore: add `noir_check_shuffle` as a critical library (noir-lang/noir#7056)
chore: clippy warning fix (noir-lang/noir#7051)
chore(ci): Unify compilation/execution report jobs that take averages with single runs  (noir-lang/noir#7048)
fix(nargo_fmt): let doc comment could come after regular comment (noir-lang/noir#7046)
fix(nargo_fmt): don't consider identifiers the same if they are equal… (noir-lang/noir#7043)
feat: auto-import traits when suggesting trait methods (noir-lang/noir#7037)
feat: avoid inserting `inc_rc` instructions into ACIR (noir-lang/noir#7036)
fix(lsp): suggest all possible trait methods, but only visible ones (noir-lang/noir#7027)
chore: add more protocol circuits to reports (noir-lang/noir#6977)
feat: avoid generating a new witness when checking if linear expression is zero (noir-lang/noir#7031)
feat: skip codegen of zero iteration loops (noir-lang/noir#7030)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 15, 2025
feat(LSP): code action to import trait in a method call (noir-lang/noir#7066)
feat!: Handle generic fields in `StructDefinition::fields` and move old functionality to `StructDefinition::fields_as_written` (noir-lang/noir#7067)
chore(ci): Check various inliner aggressiveness setttings in Brillig reports (noir-lang/noir#7049)
chore: reenable reports on rollup root circuits (noir-lang/noir#7061)
fix: don't always select trait impl when verifying trait constraints (noir-lang/noir#7041)
chore: mark some critical libraries as good again (noir-lang/noir#7065)
fix: Reduce memory usage in mem2reg (noir-lang/noir#7053)
feat: Allow associated types to be ellided from trait constraints (noir-lang/noir#7026)
chore(perf): try using vec-collections's VecSet in AliasSet (noir-lang/noir#7058)
chore: reduce number of iterations of `acvm::compiler::compile` (noir-lang/noir#7050)
chore: add `noir_check_shuffle` as a critical library (noir-lang/noir#7056)
chore: clippy warning fix (noir-lang/noir#7051)
chore(ci): Unify compilation/execution report jobs that take averages with single runs  (noir-lang/noir#7048)
fix(nargo_fmt): let doc comment could come after regular comment (noir-lang/noir#7046)
fix(nargo_fmt): don't consider identifiers the same if they are equal… (noir-lang/noir#7043)
feat: auto-import traits when suggesting trait methods (noir-lang/noir#7037)
feat: avoid inserting `inc_rc` instructions into ACIR (noir-lang/noir#7036)
fix(lsp): suggest all possible trait methods, but only visible ones (noir-lang/noir#7027)
chore: add more protocol circuits to reports (noir-lang/noir#6977)
feat: avoid generating a new witness when checking if linear expression is zero (noir-lang/noir#7031)
feat: skip codegen of zero iteration loops (noir-lang/noir#7030)
TomAFrench added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 15, 2025
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: add end step for formatting workflow
(noir-lang/noir#7070)
feat(LSP): code action to import trait in a method call
(noir-lang/noir#7066)
feat!: Handle generic fields in `StructDefinition::fields` and move old
functionality to `StructDefinition::fields_as_written`
(noir-lang/noir#7067)
chore(ci): Check various inliner aggressiveness setttings in Brillig
reports (noir-lang/noir#7049)
chore: reenable reports on rollup root circuits
(noir-lang/noir#7061)
fix: don't always select trait impl when verifying trait constraints
(noir-lang/noir#7041)
chore: mark some critical libraries as good again
(noir-lang/noir#7065)
fix: Reduce memory usage in mem2reg
(noir-lang/noir#7053)
feat: Allow associated types to be ellided from trait constraints
(noir-lang/noir#7026)
chore(perf): try using vec-collections's VecSet in AliasSet
(noir-lang/noir#7058)
chore: reduce number of iterations of `acvm::compiler::compile`
(noir-lang/noir#7050)
chore: add `noir_check_shuffle` as a critical library
(noir-lang/noir#7056)
chore: clippy warning fix (noir-lang/noir#7051)
chore(ci): Unify compilation/execution report jobs that take averages
with single runs (noir-lang/noir#7048)
fix(nargo_fmt): let doc comment could come after regular comment
(noir-lang/noir#7046)
fix(nargo_fmt): don't consider identifiers the same if they are equal…
(noir-lang/noir#7043)
feat: auto-import traits when suggesting trait methods
(noir-lang/noir#7037)
feat: avoid inserting `inc_rc` instructions into ACIR
(noir-lang/noir#7036)
fix(lsp): suggest all possible trait methods, but only visible ones
(noir-lang/noir#7027)
chore: add more protocol circuits to reports
(noir-lang/noir#6977)
feat: avoid generating a new witness when checking if linear expression
is zero (noir-lang/noir#7031)
feat: skip codegen of zero iteration loops
(noir-lang/noir#7030)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <[email protected]>
Co-authored-by: Tom French <[email protected]>
Co-authored-by: Jake Fecher <[email protected]>
AztecBot added a commit to AztecProtocol/aztec-nr that referenced this pull request Jan 16, 2025
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: add end step for formatting workflow
(noir-lang/noir#7070)
feat(LSP): code action to import trait in a method call
(noir-lang/noir#7066)
feat!: Handle generic fields in `StructDefinition::fields` and move old
functionality to `StructDefinition::fields_as_written`
(noir-lang/noir#7067)
chore(ci): Check various inliner aggressiveness setttings in Brillig
reports (noir-lang/noir#7049)
chore: reenable reports on rollup root circuits
(noir-lang/noir#7061)
fix: don't always select trait impl when verifying trait constraints
(noir-lang/noir#7041)
chore: mark some critical libraries as good again
(noir-lang/noir#7065)
fix: Reduce memory usage in mem2reg
(noir-lang/noir#7053)
feat: Allow associated types to be ellided from trait constraints
(noir-lang/noir#7026)
chore(perf): try using vec-collections's VecSet in AliasSet
(noir-lang/noir#7058)
chore: reduce number of iterations of `acvm::compiler::compile`
(noir-lang/noir#7050)
chore: add `noir_check_shuffle` as a critical library
(noir-lang/noir#7056)
chore: clippy warning fix (noir-lang/noir#7051)
chore(ci): Unify compilation/execution report jobs that take averages
with single runs (noir-lang/noir#7048)
fix(nargo_fmt): let doc comment could come after regular comment
(noir-lang/noir#7046)
fix(nargo_fmt): don't consider identifiers the same if they are equal…
(noir-lang/noir#7043)
feat: auto-import traits when suggesting trait methods
(noir-lang/noir#7037)
feat: avoid inserting `inc_rc` instructions into ACIR
(noir-lang/noir#7036)
fix(lsp): suggest all possible trait methods, but only visible ones
(noir-lang/noir#7027)
chore: add more protocol circuits to reports
(noir-lang/noir#6977)
feat: avoid generating a new witness when checking if linear expression
is zero (noir-lang/noir#7031)
feat: skip codegen of zero iteration loops
(noir-lang/noir#7030)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <[email protected]>
Co-authored-by: Tom French <[email protected]>
Co-authored-by: Jake Fecher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants